//
//  BaseNetCache.m
//  GKiOSNovel
//
//  Created by wangws1990 on 2019/6/18.
//  Copyright © 2019 wangws1990. All rights reserved.
//

#import "BaseNetCache.h"
#import "BaseDataQueue.h"
static YYMemoryCache *_memoryCache = nil;
@interface BaseNetCache()

@property (strong, nonatomic) YYMemoryCache *memoryCache;
@end
@implementation BaseNetCache

+ (YYMemoryCache *)memoryCache{
    if (!_memoryCache) {
        _memoryCache = [[YYMemoryCache alloc] init];
        _memoryCache.name = @"bookName";
    }
    return _memoryCache;
}

+ (void)setMemoryObject:(id)object forkey:(NSString *)key{
    if (![BaseNetCache.memoryCache containsObjectForKey:key] && object) {
        [BaseNetCache.memoryCache setObject:object forKey:key];
    }
}
+ (id)memoryObjectForKey:(NSString *)key{
    return [BaseNetCache.memoryCache objectForKey:key];
}
+ (void)removeMemory{
    [BaseNetCache.memoryCache removeAllObjects];
    
}

@end
